﻿using System;
using System.Collections.Generic;
using System.Text;
using Telerik.Web.UI;
using System.Web.UI;

namespace CarbonExchange.WebControls
{
    public class RadGridHyperLinkColumn : GridHyperLinkColumn
    {
        public string LinkCssClass { get; set; }

        public override void PrepareCell(System.Web.UI.WebControls.TableCell cell, GridItem item)
        {
            base.PrepareCell(cell, item);

            if (!base.DesignMode && !string.IsNullOrEmpty(LinkCssClass) && item is GridDataItem)
            {
                foreach (Control ctrl in cell.Controls)
                {
                    if (ctrl is System.Web.UI.WebControls.HyperLink)
                    {
                        ((System.Web.UI.WebControls.HyperLink)ctrl).CssClass = LinkCssClass;
                    }
                    this.Owner.Page.Trace.Warn(ctrl.GetType().ToString());
                }
            }
        }
    }
}
